home *** CD-ROM | disk | FTP | other *** search
Wrap
Miranda Installer - Developers info Using scripts in your own addon ----------------------------------- For installations, Miranda Installer uses a single XML script to describe installation. The syntax is pretty straight-forward: -------------------------------------------------------- <?xml version="1.0" encoding="ISO-8859-1" ?> <installscript> <info> <name>Name of addon</name> <author>Author of addon</author> <version>Version of addon</version> <type>[plugin | icon | sound | langpack | tool | source | doc | skin | nightly]</type> <!-- type of addon --> </info> <!-- below are installation packages the addon must have at least one package, which is the main one --> <!-- files that are in the zip but are not mentioned in any of the packages, will not be installed at all, so keep that in mind! --> <packageinfo> <optional/> <!-- optional tag, pretty much tells that the package is optional (Notice the tag is empty - i.e. No start/end pair) --> <title>Title of package</title> <!-- This is the title of the package, can be whatever you want --> <file>file1.dll</file> <!-- installation files. "file1.dll" means the file is in the root of the zip archive, use the relative path as well if it's in a relative path (i.e. "somefolder\test1.dll") --> <file>file2.dll</file> </packageinfo> <autorun> <!-- The autorun tag is only allowed once! i.e. One file to be executed per installation, tops :) --> <file>somefile.txt</file> <document/> <!-- Means the type of file is a document (Text - .txt, or HTML - .htm/.html). if this is ommitted, the user will always be asked for confirmation --> </autorun> </installscript> -------------------------------------------------------- A sample installation script (Used for PopUp plugin): -------------------------------------------------------- <?xml version="1.0" encoding="ISO-8859-1" ?> <installscript> <info> <!-- installation information --> <name>PopUp</name> <author>Hrk</author> <version>1.0.1.7</version> <type>Plugin</type> </info> <packageinfo> <title>Main Files</title> <file>popup.dll</file> </packageinfo> <packageinfo> <title>Documentation and Translation</title> <file>faq_popup.txt</file> <file>readme_popup.txt</file> <file>translation_popup.txt</file> <optional/> </packageinfo> <packageinfo> <title>Developers Info</title> <file>m_popup.h</file> <file>m_popup_inc</file> <optional/> </packageinfo> <autorun> <file>readme_popup.txt</file> <document/> </autorun> </installscript> -------------------------------------------------------- The script's DTD is at the bottom of this file. The installation script is saved as "InstallScript.xml" in the root of the zip file. A few notes: - The content of the <type> element is case-insensitive. i.e., <type>plugin</type> and <type>Plugin</type> are the same. - Before you include the script with your addon, you should always try it yourself with Miranda Installer, to make sure it works. - If Miranda Installer refuses to use the script, saying it's invalid, you should run your script through an XML validator first, to make sure the error isn't just a silly typo :) (Try: http://www.stg.brown.edu/service/xmlvalid/). - Comments *MUST NOT* be used where data is expected, i.e. don't do this: <author>Me <!-- This is my name --></author> It won't work. However, this is ok: <info> <!-- Info about the installation --> <name>...</name> ... </info> Important Stuff: - Files in the zip are copied as-is to their installation directory, no extra sub-directories are created. So, to keep the mess to a minimum, if you're adding an installation script to an installation with lots of files, You should always put the installed files in another directory in the zip, don't forget to add the changes to your script: <packageinfo> ... <file>MyPlugin\main.cpp</file> <file>MyPlugin\Info.txt</file> </packageinfo> That way, all of the files you specify will be installed (By default) into <Addon directory>\MyPlugin --------------------------------------------------- XML Script's DTD: <!ELEMENT installscript (info,packageinfo+,autorun?)> <!ELEMENT info (name,author,version,type)> <!ELEMENT name (#PCDATA)> <!ELEMENT author (#PCDATA)> <!ELEMENT version (#PCDATA)> <!ELEMENT type (#PCDATA)> <!-- one of plugin|icon|sound|langpack|tool|source|doc|skin|nightly --> <!ELEMENT packageinfo (optional?,title,file+)> <!ELEMENT optional EMPTY> <!ELEMENT title (#PCDATA)> <!ELEMENT file (#PCDATA)> <!ELEMENT autorun (file,document?)> <!ELEMENT document EMPTY> --------------------------------------------------- Miranda Installer identifies addons using their script - if an addon declares itself as an Icon (<info>...<type>Icon</type></icon>), no matter what its extension is, the addon will be treated as an icon. The file extension is only checked when an installation script is missing, or is invalid in some way. Extensions for different types of installations: *.mir - Plugin (Keeping it consistent with PluginInstaller) *.min - Nightly *.mii - Icon *.mis - Sound *.mil - Language Pack *.mit - Tool *.mio - Source *.mic - Documentation *.mik - Skin/Background Image and such